﻿<%@ Page Language="VB" MasterPageFile="~/Print.master" Title="Untitled Page" Trace="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="Club" TagName="WebContent" Src="~/UserControls/WebContent.ascx" %>

<%@ Register TagPrefix="Club" TagName="LoginBanner" Src="~/UserControls/LoginBanner.ascx" %>

<%@ Register TagPrefix="ec" Namespace="ControlSample" Assembly="EventCalendar" %>

<script runat="server"> 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim isAdmin As Boolean
        isAdmin = User.IsInRole("Administrators")
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager id="sm" runat="server"  EnableScriptGlobalization="true">
</asp:ScriptManager><div id="body">
    &nbsp;<div class="fullwidth">
            <h2>
                Events</h2>
            <br />
            <Club:WebContent ID="WebContent1" Section="EventsIntro" runat="server" />
        </div>
        <div class="eventmonth">
            <asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
                DisplayAfter="1">
                    <progresstemplate>
                        <asp:Image ID="Image1" SkinID="loading" runat="server" />
                    </progresstemplate>
            </asp:UpdateProgress>           
            <asp:UpdatePanel ID="UpdatePanel1"  RenderMode="Inline" runat="server" >
            <ContentTemplate>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"
                SelectCommand="/* GetSelectSql(ClubEvent) */ SELECT TOP 100 PERCENT EventID,starttime,title,description FROM [dbo].[ClubEvent] ORDER BY [EventID];"></asp:SqlDataSource>
                <%--<asp:ObjectDataSource ID="SqlDataSource1" runat="server" SelectMethod="SelectForCalendar"
                    TypeName="ClubStarterKit.Web.Events"></asp:ObjectDataSource>--%>
            <ec:EventCalendar runat="server" ID="eventscalendar" DataSourceID="sqldatasource1"
                BorderWidth="0" DayField="starttime" ShowTitle="true" CssClass="eventmonthtable">
                <DayHeaderStyle CssClass="caldays" />
                <DayStyle CssClass="calcurrentmonth" />
                <TodayDayStyle CssClass="calcurrentday" />
                <WeekendDayStyle CssClass="calweekend" />
                <OtherMonthDayStyle CssClass="calothermonth" />
                <DayNumberStyle CssClass="dayNumber" />
                <HeaderTemplate>
                    <table width="100%">
                        <tr align="center">
                            <td>
                                <asp:LinkButton ID="PrevMonth" runat="server" Text='<%# "&laquo; " & Container.PrevMonth.ToString("MMMM yyyy") %>'
                                    CommandName="PrevMonth" />
                            </td>
                            <td>
                                <h3>
                                    <asp:Label ID="label2" runat="server" Text='<%# Container.CurrentMonth.ToString("MMMM yyyy") %>' /></h3>
                            </td>
                            <td>
                                <asp:LinkButton ID="NextMonth" runat="server" Text='<%# Container.NextMonth.ToString("MMMM yyyy") & " &raquo;" %>'
                                    CommandName="NextMonth" />
                            </td>
                        </tr>
                    </table>
                    <div class="dashedline">
                    </div>
                </HeaderTemplate>
                <DayEventTemplate>
                    <div style="padding: 3px;">
                        <asp:HyperLink ID="HyperLink1" runat="server" Text='<%#Eval("Title") %>' NavigateUrl='<%# "view.aspx?Eventid=" &Cstr( Eval("EventID"))%>'
                            ToolTip='<%# truncate(Convert.ToString(Eval("Description"))) %>' /></div>
                </DayEventTemplate>
            </ec:EventCalendar></ContentTemplate> </asp:UpdatePanel>
            &nbsp;&nbsp;&nbsp;&nbsp;<br />
            &nbsp;&nbsp;
            <br />
            <div class="downloadevent">
                &nbsp;</div> 
            <a href="../RSS/EventRss.aspx">&nbsp;</a><br />
            <br />
            &nbsp;</div>
    </div>
</asp:Content>
